//
//  BKPlayerAudioView.h
//  BKPlayView
//
//  Created by 曹飞 on 2018/6/7.
//  Copyright © 2018年 tv.buka. All rights reserved.
//

#import <UIKit/UIKit.h>
// 播放器的几种状态
typedef NS_ENUM(NSInteger, BKAudioPlayerState) {
    BKAudioPlayerStateFailed,     // 播放失败
    BKAudioPlayerStateBuffering,  // 缓冲中
    BKAudioPlayerStatePlaying,    // 播放中
    BKAudioPlayerStateStopped,    // 停止播放
    BKAudioPlayerStatePause       // 暂停播放
};

// 回调播放时间传到上层
typedef void(^BKPlayerAudioViewPlayTimeBlock)(float currentTime,float total,BOOL isPlay);

@interface BKPlayerAudioView : UIView

@property (nonatomic,strong) NSURL *fileURL;
@property (nonatomic,strong) NSString *titleText;
@property (nonatomic,strong) UIButton * closeBtn;
@property (nonatomic,copy) BKPlayerAudioViewPlayTimeBlock timeBlock;
@property (nonatomic,copy) BKPlayerAudioViewPlayTimeBlock progressSliderTimeBlock; //滑杆松手发送状态和时间



// 设置时间并开始播放
//-(void)seekToTime:(float)seek;
- (void)seekToTime:(NSInteger)dragedSeconds completionHandler:(void (^)(BOOL finished))completionHandler;
// 开始暂停
-(void)playOrPause;

-(void)playAudio;
-(void)pauseAudio;

//默认是可控制的
-(void)canCtrl:(BOOL)ctrl;

//播放器释放问题需要主动调用
-(void)resetPlayer;

@end
